package cn.xd.itstack.springframework.beans.factory.support;

import cn.xd.itstack.springframework.core.io.DefaultResourceLoader;
import cn.xd.itstack.springframework.core.io.ResourceLoader;
import org.springframework.context.support.AbstractApplicationContext;

/**
 * @Classname AbstractBeanDefinitionReader
 * @Description TODO
 * @Date 2022/5/16 下午2:31
 * @Created by lvxiaodong
 */
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {

    private BeanDefinitionRegistry beanDefinitionRegistry;


    private ResourceLoader resourceLoader;


    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry beanDefinitionRegistry) {
        this(beanDefinitionRegistry, new DefaultResourceLoader());
    }

    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry beanDefinitionRegistry, ResourceLoader resourceLoader) {
        this.beanDefinitionRegistry = beanDefinitionRegistry;
        this.resourceLoader = new DefaultResourceLoader();
    }

    @Override
    public BeanDefinitionRegistry getBeanDefinitionRegistry() {
        return beanDefinitionRegistry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }


    @Override
    public BeanDefinitionRegistry getRegistry() {
        return beanDefinitionRegistry;
    }


}
